import req from "./config"
import { Api } from "./config/Api"
import { IBannerItem, IPageInfo, IPromiseShell, ISingerDetailItem, ISingerItem, ISongItem, ISongWithPage } from "./type"
import qs from "qs"

export const getSingerList = (pageInfo: IPageInfo, sex?: string): IPromiseShell<ISongWithPage<ISingerItem[]>> => req.get(Api.singerList + `?${qs.stringify(pageInfo)}${sex ? '&sex=' + sex : ''}`)


// ISingerDetailItem
// 根据歌手id获取歌曲
export const getSongBySingerId = (singerId: number): IPromiseShell<ISingerDetailItem[]> => req.get(Api.singerDetail + singerId)